﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="KeyWord.ascx.vb" Inherits="Control_KeyWord_KeyWord" %>
<script type="text/javascript">

    function setKeyWordParentValues() {
        var text = '';
        var sid = '';
        $("select#<%=lbxKeyWord.ClientID()%>").find("option:selected").each(function () {
            t = $(this).text();
            text += t + ';';
            sid += $(this).val() + ';';
        });
        window.parent.setKeyWordValue(text, sid);
        window.parent.tb_remove();
        return false; //prevent Submit
    }

    $(function () {
        var sListId = window.parent.getKeywordValue();
        $("#<%=txtListIdKeyWord.ClientID()%>").val(sListId);
        var arrSlistId = sListId.split(';');

        for (i = 0; i < arrSlistId.length - 1; i++) {
            $("#<%=lbxKeyWord.ClientId %> option[value=" + arrSlistId[i] + "]").attr("selected", "selected");
        }
        return false;
    });
</script>
<asp:UpdatePanel ID="upnlCreateNEWS" runat="server">
    <ContentTemplate>
        <div class="content_porletform" style="background-color: #ffffff; padding-top: 8px;">
            <div class="box_contentform">
                <div class="box_scroll_grid">
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblGroupname" CssClass="TextLabel" runat="server" Text="Nhập từ khóa: " /><span
                                class="fieldRequired"></span>
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtKeyWord" CssClass="TextBox" runat="server" Text="" Width="208px" />
                            &nbsp;<asp:Button ID="btnSave" runat="server" Text=" Lọc " CssClass="btn" />
                        </div>
                    </div>
                    <div class="DivRow" style="padding-top: 10px">
                        <div class="DivTextBox" style="float: left">
                            <asp:ListBox ID="lbxKeyWord" runat="server" Height="234px" SelectionMode="Multiple"
                                Width="208px"></asp:ListBox>
                        </div>
                        <div class="DivLabel" style="float: left">
                            &nbsp;&nbsp;<asp:Button ID="btnSelect" CssClass="btn" runat="server" CausesValidation="False"
                                Text="Chọn" /><br />
                            <br />
                            &nbsp;&nbsp;<asp:Button ID="btnEdit" CssClass="btn" runat="server" Text="Sửa" CausesValidation="False" /><br />
                            <br />
                            &nbsp;&nbsp;<asp:Button ID="btnDelete" CssClass="btn" runat="server" Text="Xóa" CausesValidation="False" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div style="display: none">
            <asp:HiddenField ID="hidID" Value="0" runat="server" />
            <asp:TextBox ID="txtListIdKeyWord" runat="server" Text=""></asp:TextBox>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
